
package com.practice2.exercise;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserTest {
    public static void main(String[] args) {
        // 加载UserTest配置文件
        ApplicationContext context = new ClassPathXmlApplicationContext("User.xml");
        user welcome = (user) context.getBean("user1");
        welcome.show();
        ((AbstractApplicationContext) context).close();
    }
}
